package com.m7.netty;

import java.util.concurrent.atomic.AtomicLong;

/**
 * @author likai
 * @date 2020/5/8 16:35
 * @email likai@7moor..com
 * @desc 时长统计
 */
public class Performance {

    private static AtomicLong atomicLong = new AtomicLong();


    /**
     * 计算总时长
     * @param time
     */
    public static void sum(long time){
        atomicLong.getAndAdd(time);
    }


    public static long getConsuming(){
        return atomicLong.get();
    }


    public static void reset() {
        atomicLong.set(0);
    }
}
